/*
 * CDeadlyPoisonStats.java
 * 
 * Copyright (c) 2009 Giles Millward (Manigra). All rights reserved.
 * 
 * This file is part of JRogueDPS.
 * 
 * JRogueDPS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * JRogueDPS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with JRogueDPS.  If not, see <http://www.gnu.org/licenses/>.
 */

package dpsstats;

/**
 *
 * @author Giles Millward (Manigra)
 */
public class CDeadlyPoisonStats {
    int m_tickCount[] = {0,0,0,0,0};
    double m_tickDamage[] = {0,0,0,0,0};

    public void addTick(int p_index, double p_damage)
    {
        m_tickCount[p_index]++;
        m_tickDamage[p_index] += p_damage;
    }
    
    public int getTickCount(int p_index)
    {
        return m_tickCount[p_index];
    }

    public double getTickDamage(int p_index)
    {
        return m_tickDamage[p_index];
    }

    public void add(CDeadlyPoisonStats p_stats)
    {
        for (int i = 0; i < 5; i++)
        {
            this.m_tickCount[i] += p_stats.getTickCount(i);
            this.m_tickDamage[i] += p_stats.getTickDamage(i);
        }
    }

    public void divideBy(int p_iterations)
    {
        for (int i = 0; i < 5; i++)
        {
            this.m_tickCount[i] /= p_iterations;
            this.m_tickDamage[i] /= p_iterations;
        }
    }
}
